package com.xshang.service.solo.impl;

import com.xshang.entity.bo.HeadLine;
import com.xshang.entity.dto.Result;
import com.xshang.service.solo.HeadLineService;
import lombok.extern.slf4j.Slf4j;
import org.simplespringframework.annotation.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @BelongsProject: simpleframework
 * @BelongsPackage: com.xshang.service.solo
 * @Author: xshang
 * @CreateTime: 2023-06-23  17:17
 * @Description: TODO
 * @Version: 1.0
 */
@Service
@Slf4j
public class HeadLineServiceImpl implements HeadLineService {
    @Override
    public Result<Boolean> addHeadLine(HeadLine headLine) {
        log.info("addHeadLine被执行了..{}", headLine);
        Result<Boolean> result = new Result<>();
        result.setCode(200);
        result.setMsg("请求成功");
        result.setData(true);
        return result;
    }

    @Override
    public Result<Boolean> removeHeadLine(int headLineId) {
        return null;
    }

    @Override
    public Result<Boolean> modifyHeadLine(HeadLine headLine) {
        return null;
    }

    @Override
    public Result<HeadLine> queryHeadLineById(int headLineId) {
        return null;
    }

    @Override
    public Result<List<HeadLine>> queryHeadLine(HeadLine headLineCondition, int pageIndex, int pageSize) {

        ArrayList<HeadLine> headLines = new ArrayList<>();

        HeadLine headLine1 = new HeadLine();
        headLine1.setLineId(1L);
        headLine1.setLineImg("图片地址：https://www.sdsdsd.com");
        headLine1.setLineName("头条1");
        headLine1.setLineLink("www.baidu.com");
        headLines.add(headLine1);

        HeadLine headLine2 = new HeadLine();
        headLine2.setLineId(2L);
        headLine2.setLineImg("图片地址：qweqwe://wqeqweqe.qwewqe.wqeqwe");
        headLine2.setLineName("头条222");
        headLine2.setLineLink("www.google.com");
        headLines.add(headLine2);

        Result<List<HeadLine>> result = new Result<>();
        result.setCode(200);
        result.setData(headLines);
        result.setMsg("查询成功");
        return result;
    }
}
